#include <dinput.h>
#include <d3d9.h>
#include <d3dx9.h>

#define		BUFFER_SIZE	256

class CDInput
{

public:
	CDInput();
	BOOL					InitDirectInput(HWND hWnd, HINSTANCE hInstance);
	BOOL					isKeyDown(int keycode);
	virtual void			ProcessInput(HWND hWnd);
	virtual void			OnKeyDown(int keycode);
	virtual void			OnKeyUp(int keycode);
	void					Release();

	POINT					m_Position;

private:

	LPDIRECTINPUT8			m_pDirectInput;
	LPDIRECTINPUTDEVICE8	m_pKeyboard;
	LPDIRECTINPUTDEVICE8	m_pMouse;
	

	BYTE					m_KeyboardState[BUFFER_SIZE];
	DIDEVICEOBJECTDATA		m_KeyEvents[BUFFER_SIZE];
	DIMOUSESTATE			m_MouseState;
};

